<?php
// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');
require dirname(__FILE__).'/constant.php';

Yii::setPathOfAlias('common', ZY_COMMON_PATH);
Yii::setPathOfAlias('frontend', ZY_FRONTEND_PATH);
Yii::setPathOfAlias('backend', ZY_BACKEND_PATH);

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'ZY',
	'homeUrl'=>'/site/',
	// preloading 'log' component
	'preload'=>array('log'),
	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
        'common.models.*',
        'common.components.*',
        'common.extensions.YiiMongoDbSuite.*',
	),
	'modules'=>array(
        
    ),
	// application components
	'components'=>array(
		// uncomment the following to enable URLs in path-format
        'mongodb' => array(
            'class' => 'common.extensions.YiiMongoDbSuite.EMongoDB',
            'connectionString' => ZY_MONGO_CONNECTION_STRING,
            'dbName' => ZY_MONGO_DBNAME,
            'persistentConnection'=>ZY_MONGO_PERSISTENT_CONNECTION,
            'fsyncFlag' => ZY_MONGO_FSYNC_FLAG,
            'safeFlag'  => ZY_MONGO_SAFE_FLAG,
            'useCursor' => ZY_MONGO_USE_CURSOR,
            'replicaSet'=> ZY_MONGO_REPLICA_SET,
        ),
        'session'=>array(
            'class'=>'common.extensions.YiiMongoDbSuite.extra.EMongoDbHttpSession',
            'cookieMode'=>'allow',
            'UseTransparentSessionID'=>false,
            'SessionName'=>'PHPSESSID',
        ),
        'cache'=>array(
            'class'=>'common.extensions.EMongoDBCache.EMongoDBCache',
            'keyPrefix'=>'95f8d2f',
            'mongoConnectionId' => 'mongodb', // (default) configId from YiiMongoDbSuite
            'collectionName' => 'cache', // (default)
            //set to false after first use of the cache to increase performance
            'ensureIndex' => true, 
        ),
		'errorHandler'=>array(
			// use 'site/error' action to display errors
			'errorAction'=>'site/error',
		),
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
				// uncomment the following to show log messages on web pages
				/*
				array(
					'class'=>'CWebLogRoute',
				),
				*/
			),
		),
	),

	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	'params'=>array(
		// this is used in contact page
		'adminEmail'=>'webmaster@example.com',
	),
);